#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "QDebug"
#include "QPushButton"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    qDebug() <<  "Init";
    ui->setupUi(this);
    QPushButton *pb = ui->pushButton;
    connect(pb, SIGNAL(pb->clicked()), this, SLOT(ClickButton()));
}

void MainWindow::ClickButton()
{
    qDebug() <<  "click";
    this->ui->pushButton->setText(tr("哈哈,我被点击了"));
}

MainWindow::~MainWindow()
{
    delete ui;
}

